Optimal. Leaf size=185 \[ \frac {19 \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 a^{3/2} d}-\frac {13 \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{2 \sqrt {2} a^{3/2} d}-\frac {\cos (c+d x) \sin (c+d x)}{2 d (a+a \sec (c+d x))^{3/2}}-\frac {7 \sin (c+d x)}{4 a d \sqrt {a+a \sec (c+d x)}}+\frac {\cos (c+d x) \sin (c+d x)}{a d \sqrt {a+a \sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.27, antiderivative size = 185, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3902, 4107,
4005, 3859, 209, 3880} \begin {gather*} \frac {19 \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{4 a^{3/2} d}-\frac {13 \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{2 \sqrt {2} a^{3/2} d}-\frac {7 \sin (c+d x)}{4 a d \sqrt {a \sec (c+d x)+a}}+\frac {\sin (c+d x) \cos (c+d x)}{a d \sqrt {a \sec (c+d x)+a}}-\frac {\sin (c+d x) \cos (c+d x)}{2 d (a \sec (c+d x)+a)^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3859
Rule 3880
Rule 3902
Rule 4005
Rule 4107
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x)}{(a+a \sec (c+d x))^{3/2}} \, dx &=-\frac {\cos (c+d x) \sin (c+d x)}{2 d (a+a \sec (c+d x))^{3/2}}-\frac {\int \frac {\cos ^2(c+d x) \left (-4 a+\frac {5}{2} a \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{2 a^2}\\ &=-\frac {\cos (c+d x) \sin (c+d x)}{2 d (a+a \sec (c+d x))^{3/2}}+\frac {\cos (c+d x) \sin (c+d x)}{a d \sqrt {a+a \sec (c+d x)}}-\frac {\int \frac {\cos (c+d x) \left (7 a^2-6 a^2 \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{4 a^3}\\ &=-\frac {\cos (c+d x) \sin (c+d x)}{2 d (a+a \sec (c+d x))^{3/2}}-\frac {7 \sin (c+d x)}{4 a d \sqrt {a+a \sec (c+d x)}}+\frac {\cos (c+d x) \sin (c+d x)}{a d \sqrt {a+a \sec (c+d x)}}-\frac {\int \frac {-\frac {19 a^3}{2}+\frac {7}{2} a^3 \sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx}{4 a^4}\\ &=-\frac {\cos (c+d x) \sin (c+d x)}{2 d (a+a \sec (c+d x))^{3/2}}-\frac {7 \sin (c+d x)}{4 a d \sqrt {a+a \sec (c+d x)}}+\frac {\cos (c+d x) \sin (c+d x)}{a d \sqrt {a+a \sec (c+d x)}}+\frac {19 \int \sqrt {a+a \sec (c+d x)} \, dx}{8 a^2}-\frac {13 \int \frac {\sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx}{4 a}\\ &=-\frac {\cos (c+d x) \sin (c+d x)}{2 d (a+a \sec (c+d x))^{3/2}}-\frac {7 \sin (c+d x)}{4 a d \sqrt {a+a \sec (c+d x)}}+\frac {\cos (c+d x) \sin (c+d x)}{a d \sqrt {a+a \sec (c+d x)}}-\frac {19 \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 a d}+\frac {13 \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{2 a d}\\ &=\frac {19 \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{4 a^{3/2} d}-\frac {13 \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{2 \sqrt {2} a^{3/2} d}-\frac {\cos (c+d x) \sin (c+d x)}{2 d (a+a \sec (c+d x))^{3/2}}-\frac {7 \sin (c+d x)}{4 a d \sqrt {a+a \sec (c+d x)}}+\frac {\cos (c+d x) \sin (c+d x)}{a d \sqrt {a+a \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 3.03, size = 197, normalized size = 1.06 \begin {gather*} -\frac {\sin (2 (c+d x))-\frac {(1+\cos (c+d x)) \left (13 \left (7 \tanh ^{-1}\left (\sqrt {1-\sec (c+d x)}\right )-4 \sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {1-\sec (c+d x)}}{\sqrt {2}}\right )-\cos (c+d x) \sqrt {1-\sec (c+d x)}+2 \cos ^2(c+d x) \sqrt {1-\sec (c+d x)}\right )-40 \, _2F_1\left (\frac {1}{2},3;\frac {3}{2};1-\sec (c+d x)\right ) \sqrt {1-\sec (c+d x)}\right ) \sec (c+d x) \tan (c+d x)}{4 \sqrt {1-\sec (c+d x)}}}{4 d (a (1+\sec (c+d x)))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(559\) vs.
\(2(156)=312\).
time = 0.15, size = 560, normalized size = 3.03
method | result | size |
default | \(-\frac {\left (-1+\cos \left (d x +c \right )\right ) \left (19 \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right ) \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sqrt {2}+26 \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right ) \ln \left (-\frac {-\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )+\cos \left (d x +c \right )-1}{\sin \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}}+38 \sin \left (d x +c \right ) \cos \left (d x +c \right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}}+52 \cos \left (d x +c \right ) \sin \left (d x +c \right ) \ln \left (-\frac {-\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )+\cos \left (d x +c \right )-1}{\sin \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}}+19 \sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sin \left (d x +c \right )+26 \ln \left (-\frac {-\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )+\cos \left (d x +c \right )-1}{\sin \left (d x +c \right )}\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sin \left (d x +c \right )-8 \left (\cos ^{5}\left (d x +c \right )\right )+20 \left (\cos ^{4}\left (d x +c \right )\right )+16 \left (\cos ^{3}\left (d x +c \right )\right )-28 \left (\cos ^{2}\left (d x +c \right )\right )\right ) \sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}}{16 d \sin \left (d x +c \right )^{3} \cos \left (d x +c \right ) a^{2}}\) | \(560\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.06, size = 536, normalized size = 2.90 \begin {gather*} \left [-\frac {13 \, \sqrt {2} {\left (\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1\right )} \sqrt {-a} \log \left (-\frac {2 \, \sqrt {2} \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 3 \, a \cos \left (d x + c\right )^{2} - 2 \, a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) + 19 \, {\left (\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) - 2 \, {\left (2 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )^{2} - 7 \, \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{8 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}}, \frac {13 \, \sqrt {2} {\left (\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1\right )} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - 19 \, {\left (\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) + {\left (2 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )^{2} - 7 \, \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{4 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cos ^{2}{\left (c + d x \right )}}{\left (a \left (\sec {\left (c + d x \right )} + 1\right )\right )^{\frac {3}{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 473 vs.
\(2 (156) = 312\).
time = 1.68, size = 473, normalized size = 2.56 \begin {gather*} \frac {\frac {13 \, \sqrt {2} \log \left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2}\right )}{\sqrt {-a} a \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} - \frac {2 \, \sqrt {2} \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{2} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {19 \, \log \left (\frac {{\left | 8 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - 16 \, \sqrt {2} {\left | a \right |} - 24 \, a \right |}}{{\left | 8 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + 16 \, \sqrt {2} {\left | a \right |} - 24 \, a \right |}}\right )}{\sqrt {-a} {\left | a \right |} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} - \frac {4 \, \sqrt {2} {\left (29 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{6} - 133 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} a + 55 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a^{2} - 7 \, a^{3}\right )}}{{\left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} - 6 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a + a^{2}\right )}^{2} \sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^2}{{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________